# NOT RUN {
## defining the range of n and theta to be evaluated
psi <- powPar(n = seq(from = 20, to = 60, by = 2),
theta = seq(from = 0.5, to = 1.5, by = 0.1),
muA = 0,
muB = 1)
## extracting all elements of psi individually, starting with the first
n(psi)
theta(psi)
xi(psi)
## extracting all elements, not just the actual:
pp(psi, name = "n")
pp(psi, name = "theta")
pp(psi, name = "xi")
## an example of usage
powFun <- function(psi){
power.t.test(n = n(psi),
delta = pp(psi, "muA") - pp(psi, "muB"),
sd = theta(psi)
)$power
}
## testing the power-function
powFun(psi)
# }
Run the code above in your browser using DataLab